# run.py
from app import create_app, db
from app.models import User, OutcomeType, Outcome # 导入模型，以便 Flask-Migrate 能检测到它们

app = create_app()

# 可选: 让 db, User 等在 'flask shell' 中可用
@app.shell_context_processor
def make_shell_context():
    return {'db': db, 'User': User, 'OutcomeType': OutcomeType, 'Outcome': Outcome}

if __name__ == '__main__':
    # 考虑添加 host='0.0.0.0' 使得在开发时局域网内其他设备也能访问
    # Flask 默认端口是 5000
    app.run(debug=True, port=5000)
